<template>
  <a-modal
    :footer="null"
    title="领取统计"
    v-model="visible"
    @ok="onClose"
    @cancel="onClose"
  >
    <a-spin :spinning="loading">
      <a-row :gutter="[10, 10]">
        <a-col :span="8">
          <a-card>
            <a-statistic
              title="会计同行"
              :value="receiveData.this_today_zlx"
              :value-style="{ color: '#3f8600' }"
            >
            </a-statistic>
          </a-card>
        </a-col>
        <a-col :span="8">
          <a-card>
            <a-statistic
              title="ISO"
              :value="receiveData.this_month_zlx"
              :value-style="{ color: '#3f8600' }"
            >
            </a-statistic>
          </a-card>
        </a-col>
        <a-col :span="8">
          <a-card>
            <a-statistic
              title="驳回复审"
              :value="receiveData.last_month_zlx"
              :value-style="{ color: '#3f8600' }"
            >
            </a-statistic>
          </a-card>
        </a-col>
        <a-col :span="8">
          <a-card>
            <a-statistic
              title="专利黄页"
              :value="receiveData.last_month_zlx"
              :value-style="{ color: '#3f8600' }"
            >
            </a-statistic>
          </a-card>
        </a-col>
        <a-col :span="8">
          <a-card>
            <a-statistic
              title="送达公告"
              :value="receiveData.last_month_zlx"
              :value-style="{ color: '#3f8600' }"
            >
            </a-statistic>
          </a-card>
        </a-col>
        <a-col :span="8">
          <a-card>
            <a-statistic
              title="商标变更"
              :value="receiveData.last_month_zlx"
              :value-style="{ color: '#3f8600' }"
            >
            </a-statistic>
          </a-card>
        </a-col>
        <a-col :span="8">
          <a-card>
            <a-statistic
              title="商标续展"
              :value="receiveData.last_month_zlx"
              :value-style="{ color: '#3f8600' }"
            >
            </a-statistic>
          </a-card>
        </a-col>
      </a-row>
    </a-spin>
  </a-modal>
</template>

<script>
import { getDataDetail } from '@/api/adviser'

export default {
  name: 'ReceiveState',
  data () {
    return {
      loading: false,
      visible: false,
      receiveData: {},
      yjData: {},
      tab: '2'
    }
  },
  created () {
    this.initModal()
  },
  methods: {
    initModal () {
      const app = this
      app.loading = true
      if (app.tab === '2') {
        getDataDetail('lx').then(res => {
          if (res.status === 0) {
            app.modalTitle = '当月领新'
            app.receiveData = res.result
            app.visible = true
            app.loading = false
          } else {
            app.$warning({
              title: res.msg
            })
          }
        })
      }
    },
    onClose () {
      this.visible = false
      this.$emit('cancel', this.visible)
    }
  }
}
</script>

<style scoped>

</style>
